home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / strtable.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  756b  |  28 lines

  1. #ifndef __KH_STRING_TABLE_H_
  2. #define __KH_STRING_TABLE_H_
  3.  
  4. #include <alloc.h>
  5. #include <string.h>
  6.  
  7.  
  8. /*    KH_STRTABLE provides set of data and operations on the (char**)
  9.       - group of strings.
  10. */
  11.  
  12. struct KH_STRTABLE
  13.     {
  14.     int used;                               // Total number of strings
  15.     int total;                              // Allocated
  16.     char** strings;                         // Strings
  17.  
  18.     KH_STRTABLE(int n, char** str = NULL);  // Builds string array. If str
  19.                         //   is NULL, sets all strings to
  20.                         //   '\0'.
  21.     ~KH_STRTABLE();
  22.  
  23.     int add(char* str);                     // Append to the end of list
  24.  
  25.     char* operator [](int n) { return strings[n]; }
  26.     };
  27.  
  28. #endif __KH_STRING_TABLE_H_